<template>
  <el-aside width="200px" class="left-menu">
    <el-row>
    <el-col :span="12">
      <el-menu
        default-active="1-1"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b">
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>帖子管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="1-1" @click="goToPost()">帖子管理</el-menu-item>
            <el-menu-item index="1-2" @click="goToPostRecord()">处理记录</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>举报管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="1-3" @click="goToInform()">举报管理</el-menu-item>
            <el-menu-item index="1-4" @click="goToInformHandleRecord()">处理记录</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>人员管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="3-1" @click="goToUser()">人员信息</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>评论管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="4-1" @click="goToComment()">评论管理</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-col>
    </el-row>

  </el-aside>
</template>

<script>
export default {
  name: 'aside',
  data () {
    return {
      isCollapse: true
    }
  },
  methods: {
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    },
    goToInform () {
      this.$router.push('/adminDashboard/adminInform')
    },
    goToInformHandleRecord () {
      this.$router.push('/adminDashboard/informHandleRecord')
    },
    goToPost () {
      this.$router.push('/adminDashboard/adminPost')
    },
    goToPostRecord () {
      this.$router.push('/adminDashboard/PostHandleRecord')
    },
    goToUser () {
      this.$router.push('/adminDashboard/adminUser')
    },
    goToComment () {
      this.$router.push('/adminDashboard/adminComment')
    }
  }
}
</script>

<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
.el-aside {
  display: block;
  position: relative;
  overflow-y: scroll;
  color: #545C64;
}
.left-menu{
  height: 100vh;
}
</style>
